import pandas as pd



def read_csv():
    filepath = "../course_datas/c42_split_onecolumn_tomany/学生数据表.xlsx"
    df = pd.read_excel(filepath)

    df_new = df.apply(chai_line,axis=1)

    # 删除 源数据  数据 列
    df_new.drop(['数据'],axis=1,inplace=True)
    # print(df_new)
    # 将数据 输出到 excel
    df_new.to_excel("./file/学生数据表_数据拆分.xlsx")

# 数据拆分
def chai_line(df):
    df["姓名"],df['性别'],df['年龄'],df['户籍'] = df['数据'].split(":")
    return df

























if __name__ == '__main__':
    read_csv()